{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/DrewThomasson/ebook2audiobook/blob/main/Notebooks/colab_ebook2audiobook.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Welcome to the ebook2audiobook free google colab!\n",
        "## 🌟 Features\n",
        "\n",
        "- 📖 Converts eBooks to text format with Calibre.\n",
        "- 📚 Splits eBook into chapters for organized audio.\n",
        "- 🎙️ High-quality text-to-speech with Coqui XTTS and Fairseq.\n",
        "- 🗣️ Optional voice cloning with your own voice file or choose from our pre-made fine-tuned models!\n",
        "- 🌍 Supports multiple languages! Arabic (ar), Chinese (zh-cn), Czech (cs), Dutch (nl), English (en), French (fr), German (de), Hindi (hi), Hungarian (hu), Italian (it), Japanese (ja), Korean (ko), Polish (pl), Portuguese (pt), Russian (ru), Spanish (es), Turkish (tr), Vietnamese (vi), [+ 1107 languages via Fairseq](https://dl.fbaipublicfiles.com/mms/tts/all-tts-languages.html)\n",
        "## Want to run locally for free? ⬇\n",
        "## [Check out the ebook2audiobook github!](https://github.com/DrewThomasson/ebook2audiobook)"
      ],
      "metadata": {
        "id": "DKNNnwD-HJwQ"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# @title 🛠️ Install requirments\n",
        "#!DEBIAN_FRONTEND=noninteractive\n",
        "!sudo apt-get update # && sudo apt-get -y upgrade\n",
        "!sudo apt-get -y install libegl1\n",
        "!sudo apt-get -y install libopengl0\n",
        "!sudo apt-get -y install libxcb-cursor0\n",
        "!sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin\n",
        "!sudo apt-get install -y ffmpeg\n",
        "!apt-get install -y mecab libmecab-dev mecab-ipadic-utf8\n",
        "!pip install mecab-python3\n",
        "#!sudo apt-get install -y calibre\n",
        "#!git clone https://github.com/DrewThomasson/ebook2audiobook.git\n",
        "!git clone https://github.com/DrewThomasson/ebook2audiobook.git temp_repo && mv temp_repo/* temp_repo/.* ./ && rm -rf temp_repo\n",
        "!pip install -r /content/requirements.txt"
      ],
      "metadata": {
        "id": "Edxj355K0rUz",
        "collapsed": true,
        "cellView": "form"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# @title 🚀 Run ebook2audiobook! (Make sure to set the runtime to have gpu to have faster generation speeds! :)\n",
        "\n",
        "# Start the app with Share=True for the gradio interface\n",
        "!python /content/app.py --share"
      ],
      "metadata": {
        "id": "658BTHueyLMo",
        "cellView": "form"
      },
      "execution_count": 2,
      "outputs": []
    }
  ]
}